<?php include $this->getViewFile('/common/Head') ?>
<body class="J_scroll_fixed">
<style>
.col-left{float:left}
.col-auto{overflow:hidden;_zoom:1;_float:left;}
.title-1{border-bottom:1px solid #eee; padding-left:5px}
.f14{font-size: 14px}
.lh28{line-height: 28px}
.blue,.blue a{color:#004499}
.gray4,a.gray4{color:#999;}
.lh22{line-height: 22px}
.lh25{line-height: 25px}
</style>
<div class="wrap J_check_wrap">
  <?php include $this->getViewFile('/common/Nav') ?>
  <div class="h_a">查找</div>
    <div class="search_type cc mb10">
      <form method="post" action="" id="searchForm">
      <div class="mb10"> 操作人：
        <?php
		$adminList = array();
		foreach(AdminUser::model()->getUserList() as $rs){
			$adminList[$rs['admin_id']] = $rs['real_name'];
		}
		echo Form::select($adminList,$admin_id,'name="admin_id"','全部');
		?>
        栏目：
        <select class="select_2" name="cat_id">
          <option value=''>不限栏目</option>
          <?php  echo CategoryModel::model()->htmlCategorySelectOption($cat_id); ?>
        </select>
        上架时间：
        <input type="text" name="start_time" class="input length_2 J_date" value="<?php echo $start_time?>" placeholder="选择起始时间">
        -
        <input type="text" class="input length_2 J_date" name="end_time" value="<?php echo $end_time?>" placeholder="选择结束时间">
        统计时间：
        <input type="text" name="start_time2" class="input length_2 J_date" value="<?php echo $start_time2?>" placeholder="选择起始时间">
        -
        <input type="text" class="input length_2 J_date" name="end_time2" value="<?php echo $end_time2?>" placeholder="选择结束时间">
      </div>
      <div class="mb10">
        排序：<?php echo Form::select(array(0=>'总浏览数倒序',1=>'销量倒序'),$order,'name="order"') ?>关键字：<?php echo Form::select(array(1=>'商品ID'/*,3=>'商品旺旺',4=>'订单编号'*/),$type,'name="type"') ?>
        <input type="text" class="input length_2" name="keyword" style="width:200px;" value="<?php echo $keyword?>" placeholder="请输入搜索内容...">
        <button class="btn">搜索</button>
      </div>
      </form>
      <form method="post" action="<?php echo AdminBase::U("reset_turnover") ?>">
      <div class="mb10">
        成交数重新计算：<input type="text" name="reset_time" class="input length_2 J_date" value="<?php echo $reset_time?>" placeholder="选择时间">
        <button class="btn">执行</button>
      </div>
      </form>
    </div>
  <div class="mb10"> 共有 ( <b><?php echo $count; ?></b> ) 个宝贝，销售总数：<b><?php echo $dangSum ?></b>，销售总额：<b><?php echo $zongSales ?>元</b></div>
  <form name="myform" action="<?php echo AdminBase::U("index") ?>" method="post" class="J_ajaxForm">
    <div class="table_list">
      <table width="100%" cellspacing="0">
        <thead>
          <tr>
            <td width="100" align="center">商品ID</td>
            <td>商品报名信息</td>
            <td align="center">浏览数</td>
            <td align="center">会员访问</td>
            <td align="center">游客访问</td>
            <td align="center">成交额</td>
            <td align="center">销量</td>
            <td width="100" align="center">审核人员</td>
          </tr>
        </thead>
        <tbody>
          <?php
		  foreach($data as $rs){
		  ?>
          <tr>
            <td align="center"><?php echo $rs->product_id ?><br/>报名ID：<?php echo $rs->goods_id ?></td>
            <td>
            <div class="col-left mr10" style="width:146px; height:112px"><a href="<?php echo $rs->GoodsModel->detail_url?>" target="_blank"><img src="<?php echo $rs->GoodsModel->product_img?>" width="146" height="112" style="border:1px solid #eee" align="left"></a></div>
              <div class="col-auto">
                <h2 class="title-1 f14 lh28 mb6 blue"><a href="<?php echo $rs->GoodsModel->detail_url ?>" target="_blank"><?php echo $rs->GoodsModel->goods_name ?>(<?php echo $rs->month?>月<?php echo $rs->day?>号)</a></h2>
                <p class="gray4 lh25"> 原价：<font color="#FF0000"><?php echo  number_format($rs->GoodsModel->p_price,2)?></font>， 
                  活动价：<font color="#FF0000"><?php echo  number_format($rs->GoodsModel->promo_price,2)?></font>，
                  销量：<font color="#FF0000"><?php echo (int)$rs->sales;?></font>，
                  旺旺：<b><a href="http://amos.im.alisoft.com/msg.aw?v=2&amp;site=cntaobao&amp;s=2&amp;charset=utf-8&amp;uid=<?php echo urlencode($rs->GoodsModel->nick)?>" target="_blank"><?php echo $rs->GoodsModel->nick?><img src="http://amos.im.alisoft.com/online.aw?v=2&amp;site=cntaobao&amp;s=2&amp;charset=utf-8&amp;uid=<?php echo urlencode($rs->GoodsModel->nick)?>" alt=""></a></b> 店铺类型：<font color="#FF0000"><?php echo GoodsBmModel::model()->getShopTypeName($rs->GoodsModel->item_type); ?></font> </p>
                <p class="gray4 lh25"> 报名时间：<font color="#000000"><?php echo date('Y-m-d H:i:s',$rs->add_time)?></font>，
                  报名栏目：<font color="#0033FF"><?php echo CategoryModel::model()->getCategory($rs->cat_id,'cat_name');?></font> </p>
                <p class="gray4 lh25"> 上架时间：<font color="#FF33FF"><?php echo date('Y-m-d H:i:s',$rs->start_time)?></font> ，
                  下架时间：<font color="#FF33FF"><?php echo date('Y-m-d H:i:s',$rs->end_time)?></font> </p>
              </div>
            </td>
            <td align="center"><?php echo $rs->view?></td>
            <td align="center"><?php echo $rs->userfanw?></td>
            <td align="center"><?php echo $rs->youkefanw?></td>
            <td align="center"><?php echo number_format($rs->sales,2)?></td>
            <td align="center">总数：<?php echo $rs->turnover?><br/>官网：<?php echo $rs->guan_turnover?><br/>优站：<?php echo $rs->you_turnover?></td>
            <td align="center"><?php echo AdminUser::model()->getByUidFindName($rs->admin_id) ?></td>
          </tr>
          <?php
		  }
		  ?>
        </tbody>
      </table>
      <div class="p10">
        <div class="pages"><?php echo $Page;?></div>
      </div>
    </div>
  </form>
</div>
<script src="<?php echo $staticUrl; ?>statics/js/common.js"></script> 
<script>
$(function(){
	$('.table_list select[name="recommend"]').change(function(){
		var id = $(this).data('id');
		var recommend = $(this).val();
		$.getJSON('<?php echo AdminBase::U("saveuser") ?>',{id:id,recommend:recommend},function(data){
			if(data.status){
				
			}else{
				alert(data.info);
			}
		});
	});
});
</script>
</body>
</html>